﻿<%@ Page Language="C#" AutoEventWireup="True" 
    CodeBehind="ListList.aspx.cs" 
    Inherits="Medianamik.UI.NodeManagement.ListList" 
    MasterPageFile="~/Medianamik/MasterPages/MedianamikModule.Master" %>
<%@ Import Namespace="Medianamik.Core"%>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
<asp:UpdatePanel ID="addNodeUpdatePanel" runat="server" UpdateMode="Conditional"
        ChildrenAsTriggers="true">
        <ContentTemplate>
            <asp:HyperLink ID="lnkAddNode" runat="server" Target="ListTypeSelectorWindow" class="Action BtAjouter"
                onclick="GetRadWindowManager().Open(null, 'ListTypeSelectorWindow');" Text="<%$ Resources: Medianamik_ContentManagement, NewNodeButtonText %>" />
        </ContentTemplate>
    </asp:UpdatePanel></asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:Label ID="NoTypeMessage" runat="server" Visible="false" Text="<%$ Resources : Medianamik_ContentManagement, NoListableType %>" />
    <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <lock:LockInfoToolTip runat="server" ID="LockInfoTooltip" OnLockDeleted="LockInfoTooltip_LockDeleted" />
            <p>
                <asp:DropDownList ID="cbTypes" 
                                  runat="server" 
                                  AllowCustomText="false" 
                                  AutoPostBack="true"
                                  OnSelectedIndexChanged="SelectType"
                                  CssClass="SelectList"
                                  />
                <asp:PlaceHolder ID="FilterPlaceHolder" runat="server" Visible="false">
                    <asp:Literal runat="server" Text="Filtre:" />&nbsp;
                    <asp:TextBox ID="FilterBox" runat="server" CssClass="TxtBox" /> &nbsp; 
                    <asp:Button ID="RefreshButton" 
                                runat="server" 
                                CssClass="Btn" 
                                OnClick="FilterList" 
                                UseSubmitBehavior="false" 
                                Text="<%$ Resources : Medianamik_ConfigurationManagement, RefreshLogGrid %>" />
                </asp:PlaceHolder>
            </p>
            <telerik:RadGrid ID="NodeList" 
                             runat="server" 
                             Skin="Medianamik" 
                             EnableEmbeddedSkins="false"
                             AutoGenerateColumns="false"
                             OnNeedDataSource="GridNeedDataSource"
                             OnItemDataBound="GridItemDataBound"
                             AllowPaging="true"
                             AllowCustomPaging="true"
                             PageSize="20"
                             PagerStyle-Position="TopAndBottom"
                             PagerStyle-AlwaysVisible="true"
                             PagerStyle-Mode="NextPrevAndNumeric">
                <MasterTableView>
                    <NoRecordsTemplate>
                        <asp:Literal ID="noRecords" runat="server" Text="<%$ Resources: Medianamik_ContentManagement, NoRecordsToDisplay %>" />
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn DataField="DisplayName">
                            <HeaderTemplate>
                                <asp:Literal runat="server" Text="<%$ Resources: Medianamik_ContentManagement, ContentNameColumn %>" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <med:NodeTypeIcon runat="server" NodeTypeId='<%# Eval("NodeType.ID") %>' />
                                <%# Eval("DisplayName") %>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

<asp:Content ID="ExternalContent" ContentPlaceHolderID="ExternalContentHolder" runat="server">
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">
        <script type="text/javascript">
            //<![CDATA[
            <%= Medianamik.UI.Utility.GetTypeSelectedScript("/Medianamik/ContentManagement/NodeManagement.aspx", 
                true, DefaultParamNames.ParentNodeID, DefaultParamNames.TypeID, BuildReturnUrl()) %>
            
            <%= Medianamik.UI.Utility.GetDeleteElementScript(RadAjaxManager.GetCurrent(Page).ClientID,
                Medianamik.Core.Pages.DeleteElementWindow, CurrentEditionCulture.Name, 
                true, CurrentEditionCulture.Name == "") %>
            //]]>
        </script>
</telerik:RadScriptBlock>
</asp:Content>
